package com.qf.service.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.codingapi.txlcn.tc.annotation.TccTransaction;
import com.qf.dao.TransferDao;
import com.qf.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service
public class TransferServiceImpl implements TransferService {



    @Autowired
    TransferDao transferDao;
    @Override
    @Transactional
    @LcnTransaction //分布式事务注解
    public String transfer(Map map) {
        String payUser = map.get("receiveUser").toString();
        Double money = Double.valueOf(map.get("money").toString());
        //入库
        transferDao.recive(payUser,money);
        return "ok";
    }
}
